<?php
if(!isset($class)) {
	$class= " tip-fullview";
}

?>
<div class="tip<?php echo $class;?>">
	<h2 class="attribute-name title">
		<?php echo $html->link(__('Tip by ', true) . $tip['Tip']['name'], array('action'=>'view', $tip['Tip']['id'])); ?>
	</h2>
	<div class="tip-inner">
		<div class="attribute-body">
			<?php echo $textile->TextileRestricted($tip['Tip']['body']); ?>
		</div>
		<dl>
			<dt class="attribute-date"><?php __('Posted:');?></dt>
			<dd class="attribute-date"><?php echo $time->niceShort($tip['Tip']['created']) ?></dd>
			<dt class="attribute-name"><?php __('By:');?></dt>
			<dd class="attribute-name">
				<?php if(!empty($tip['Tip']['url'])):?>
					<?php echo $html->link($tip['Tip']['name'],$tip['Tip']['url'] ,array('rel'=>'external')); ?>
				<?php else: ?>
					<?php echo $tip['Tip']['name']; ?>
				<?php endif; ?>
			</dd>
			<dt class="attribute-ip"><?php __('IP:');?></dt>
			<dd class="attribute-ip"><?php echo $tip['Tip']['ip']; ?></dd>
			<?php if(isset($is_admin) and $is_admin): ?>
			<dt class="attribute-email"><?php __('Email:');?></dt>
			<dd class="attribute-email"><?php echo $html->link($tip['Tip']['email'], "mailto:" . $tip['Tip']['email'] ,array('rel'=>'external')); ?></dd>
			<?php endif; ?>
			<dt class="attribute-actions"><?php __('Actions:');?></dt>
			<dd class="attribute-actions">
				<?php if($is_admin or $tip['Tip']['can_edit'] == true):?>
				<?php echo $html->link(__('Edit', true), array('action'=>'edit', $tip['Tip']['id']),array('class'=>'button-link')); ?>
				<?php endif; ?>
				<?php if($is_admin): ?>
				<?php echo $html->link(__('Delete', true), array('action'=>'delete', $tip['Tip']['id']),array('class'=>'button-link'), sprintf(__('Are you sure you want to delete # %s?', true), $tip['Tip']['id'])); ?>
				<?php 
				if(!$tip['Tip']['approved']) {
					echo $html->link(__('Approve', true), array('action'=>'approve', $tip['Tip']['id']),array('class'=>'button-link'));
				} else {
					echo $html->link(__('Deapprove', true), array('action'=>'approve', $tip['Tip']['id'], 0),array('class'=>'button-link'));
				}
				?>
				<?php endif; ?>
			</dd>
		</dl>
	</div>
</div><!-- End tip -->
<?php if($class == ' tip-fullview'):?>
	<p class="attribute-link refererlink">
		<?php  echo $html->link(__('Back to tips', true), $referer ); ?>
	</p>
	<?php echo $this->element('../comments/embed', array('plugin' => 'comments', 'cache'=>'+2 hour')); ?>
<?php endif;?>